package top.resty.erp.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.resty.erp.dao.IManager;
import top.resty.erp.domain.Manager;
import top.resty.erp.service.ManagerService;

import java.util.List;

@Service
public class ManagerServiceImpl implements ManagerService {
	
	@Autowired
	private IManager iManager;
	
	@Override
	public Manager getUserForNameAndPassword(Manager manager) {
		return iManager.getUserForNameAndPassword(manager);
	}
	
	@Override
	public List<Manager> getManagers() {
		return iManager.getManagers();
	}
	
	@Override
	public int saveManager(Manager manager) {
		return iManager.saveManager(manager);
	}
	
	@Override
	public int delManager(Integer index) {
		return iManager.delManager(index);
	}
	
	@Override
	public boolean getName(String userName) {
		int count = iManager.getName(userName);
		if(count==0){
			//代表未查询到,可以注册
			return true;
		}
		return false;
	}
	
	@Override
	public int updateManager(String keyStr, String valueStr, Integer id) {
		return iManager.updateManager(keyStr, valueStr, id);
	}
	
	@Override
	public Manager findManagerByRealName(String realName) {
		return iManager.findManagerByRealName(realName);
	}
	
	
}
